package com.bgIntlgn.client.entity.jishubu;

import yuhuibear.poat.annotations.action.AutoGenerateValue;
import yuhuibear.poat.annotations.relation.Field;
import yuhuibear.poat.annotations.relation.Table;
import yuhuibear.poat.object.bean.Bean;

/**
 * 产品实体
 * 
 * @author yuhui
 * 
 */

@Table(name = "elements", constrain = " unique(name, type, root_type)")
public class Element implements Bean {

	@AutoGenerateValue(skipOnNull = true, sqlToGet = "select currval('elements_id_seq')")
	@Field(name = "id", type = "bigserial", constrain = "primary key ")
	private Long id;

	/**
	 * 系列名称
	 */
	@Field(name = "name", type = "varchar(60)", constrain = "not null")
	private String name;

	/**
	 * 分类(标志为零件、组件、还是产品)
	 */
	@Field(name = "type", type = "int8", constrain = " references dictionarys(id) on update cascade  ")
	private Long type;

	@Field(name = "oem", type = "boolean ", constrain = "default false")
	private boolean oem;

	/**
	 * uid 的大类.
	 */
	@Field(name = "root_type", type = "int8", constrain = " references dictionarys(id) on update cascade ")
	private Long rootType;

	/**
	 * uid 的小类.
	 */
	@Field(name = "sub_type", type = "int8", constrain = " references dictionarys(id) on update cascade ")
	private Long subType;

	/**
	 * 表示当前这个东西的实体单位， 套， 个等等。。。
	 */
	@Field(name = "unit", type = "int8", constrain = "not null references dictionarys(id) on update cascade ")
	private Long unit;

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getType() {
		return this.type;
	}

	public void setType(Long type) {
		this.type = type;
	}

	public Long getUnit() {
		return this.unit;
	}

	public void setUnit(Long unit) {
		this.unit = unit;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getRootType() {
		return this.rootType;
	}

	public void setRootType(Long rootType) {
		this.rootType = rootType;
	}

	public Long getSubType() {
		return this.subType;
	}

	public void setSubType(Long subType) {
		this.subType = subType;
	}

	public boolean isOem() {
		return oem;
	}

	public void setOem(boolean oem) {
		this.oem = oem;
	}
}
